﻿#include <iostream>
#include <chrono>
#include <list>
#include <deque>
#include <vector>
#include <memory>

class Member
{
public:
    ~Member() { std::cout << "Member destruct." << std::endl; }

private:
};

class Base
{
public:
    virtual void func() { std::cout << "Base func." << std::endl; }
    virtual ~Base() { std::cout << "Base destruct." << std::endl; }

private:
};

class Sub : public Base
{
public:
    virtual void func() { std::cout << "Sub func." << std::endl; }
    ~Sub() { std::cout << "Sub destruct." << std::endl; }

private:
    Member member_;
};

int main()
{
    {
        // std::shared_ptr<Base> entity = std::shared_ptr<Sub>(new Sub());
        Base *entity = new Sub();
        entity->func();
        delete entity;
        entity = nullptr;
    }

    std::cout << "main end." << std::endl;

    return 0;
}